#ifndef __TE_GAMEENGINE_H
#define __TE_GAMEENGINE_H

// Alright, time to clean up this utterly disgusting mess

#include "te_local.h"
#include "og/CVarSystemEx.h"

class GameEngine
{
public:
	GameEngine();
	~GameEngine();

	static GameEngine *GetSingleton();
	static void DestroySingleton();
	static void KillGameInstance();
	static void SetStartupArgs(int argc, char **argv) { startArgc = argc; startArgv = argv; };

	void Run();

	void Video_Restart();

private:
	static GameEngine *instance;
	static bool killedGame;
	bool video_restart; // only used by the main loop

	// Console
	void CON_Init();
	void CON_Shutdown();

	// Config thing, prevent whining
	void ConfigRead();

	// File System
	void FS_Init();
	void FS_Shutdown();

	// Renderer
	void R_Shutdown();

	// Startup Args
	static int startArgc;
	static char **startArgv;
};

#endif